<template>
  <div class="hello">
    <!-- hello-world -->
    <a :href="url" target="_blank">查看考勤表单!</a>

    <div class="hello-table">
     <p class="item" v-for="(item,index) in tableContent" :key="index">{{item}}</p>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "HelloWorld",
  data() {
    return {
      url: "",
      tableContent: [],
    };
  },
  mounted() {
    axios.get("/api/app/datahelloworld/test/url").then((response) => {
      if (response.status === 200) {
        this.url = response.data;
      }
    });

    axios.get("/api/app/datahelloworld/test/data").then((response) => {
      if (response.status === 200) {
        const {  content } = response.data;
        this.tableContent = content

      }
    });
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
.hello-table .item {
  margin: 30px 0;
}
</style>
